from time import time
f1=open('m1_sorted.txt')
a1=f1.readlines()
f1.close()
f2=open('m2_reverse.txt')
a2=f2.readlines()
f2.close()
f3=open('m3_shuffle.txt')
a3=f3.readlines()
f3.close()
def buble_sort(a):
    n=len(a)
    for i in range(n-1):
        for  j in range(n-1-i):
            if a[j]>a[j+1]:
                a[j],a[j+1]=a[j+1],a[j]
    return a
b1=[]
for i in range(len(a1)):
    x1=int(a1[i])
    b1.append(x1)
t0=time()
d1=buble_sort(b1)
t1=time()
print(t1-t0)
b2=[]
for i in range(len(a2)):
    x2=int(a2[i])
    b2.append(x2)
t0=time()
d2=buble_sort(b2)
t1=time()
print(t1-t0)
b3=[]
for i in range(len(a3)):
    x3=int(a3[i])
    b3.append(x3)
t0=time()
d3=buble_sort(b3)
t1=time()
print(t1-t0)
print(*d3)
